<template>
  <div>
      <h1>登录界面</h1>
      <el-row>
        <el-col :span="5">用户名:<el-input v-model="obj.name" ></el-input></el-col>
         
      </el-row>
      <el-row>
        <el-col :span="5"> 密码:<el-input type="password" v-model="obj.pwd" ></el-input></el-col>
      </el-row>
      <el-button type="primary" @click="login">登录</el-button>
          
      </div>


</template>

<script>

export default {
  
   data(){
      return {
        obj:{}
      }
   },
   methods:{
    
       async login(){
           
          var user = await this.ajax.getSubmit("/project/users/login",this.obj)
          if(user.length != 0){
             
             alert("登录成功");
             this.$router.push("/manage/user");
          }
          else{
             alert("登录失败");
          }
       }
   }
}
</script>

<style>

</style>
